<template>
  <el-card>
    <el-form :inline="true" >
      <el-row>
        <el-col :span="24">
          <el-form-item label="用户名" style="width: 100%">
            <el-input v-model="username" placeholder="用户名"  />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="密　码" style="width: 100%">
            <el-input v-model="password" placeholder="密　码"  />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-form-item>
          <el-button type="primary" @click="onLogin()">登录</el-button>
        </el-form-item>
      </el-row>
    </el-form>
  </el-card>
</template>

<script setup lang="ts">
import { Login, Logout } from "@/common/index";
import type { IUserInfo } from "@/models/IUserInfo";
import { ref } from "vue";
const username = ref("管理员");
const password = ref("123456");

const onLogin = () => {
  //登录
  let userInfo: IUserInfo = {
    name: username.value,
    password: password.value,
  };

  Login(userInfo);
};
</script>

<style scoped></style>
